A “raw fuel” stream typically refers to fuel that is obtained from a well. Often, such fuels are also referred to as “raw well head gases.” Raw well head gases can be used by spark ignited piston engines in order to power generators, pumps, compressors, etc., that are employed for a variety of applications. In order to tune and optimize engine performance, it is desirable to know the relative amounts of methane, non-methane hydrocarbons, and carbon dioxide in the raw well head gas supplying the engine. This is because engine performance is often limited by autoignition of a fuel charge, which causes the phenomenon referred to as “knock,” An engine experiencing knock can quickly be destroyed or otherwise damaged. Methane is very resistant to knock. However, most non-methane hydrocarbons are less resistant to knock, and therefore they tend to reduce engine performance as compared to methane. Carbon dioxide is an inert gas and does not contribute to the energy of the fuel. Accordingly, when carbon dioxide is present in a fuel, more total fuel must flow to maintain a certain engine power. Thus, knowing the composition of the fuel enables adjustments to engine configurations and the relative amounts of fuel required, which can improve engine performance and avoid potentially damaging engine knock.